﻿<navigation:Page xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"  
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
  xmlns:System_Windows_Controls_Primitives="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls"
  xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
  xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
  x:Class="BuildARouteApp.Home"
  mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"  
  Style="{StaticResource PageStyle}"
  xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.DomainServices"
  xmlns:my="clr-namespace:BuildARouteApp.Web.Services"
  xmlns:my1="clr-namespace:BuildARouteApp.Web.Models">

  <Grid x:Name="LayoutRoot">
       
    <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" HorizontalAlignment="Stretch" Margin="0,2,0,434"><Run Text="Welcome to the build-a-route website. Here you can author tour routes that will be available on every phone running the "/><Run FontStyle="Italic" Text="Tour Guide App" TextDecorations="Underline"/><Run Text=". Go ahead and create a new route now, manage routes you've created or simply check out routes others have authored."/></TextBlock>
     
    <Grid x:Name="ContentGrid" Width="640" Margin="0,52,0,0">
    	
            <sdk:DataGrid AutoGenerateColumns="False" Height="401" HorizontalAlignment="Left" ItemsSource="{Binding ElementName=tourDomainDataSource, Path=Data}" Margin="1,0,0,0" Name="tourDataGrid" RowDetailsVisibilityMode="VisibleWhenSelected" VerticalAlignment="Top" Width="308">
                <sdk:DataGrid.Columns>
                    <sdk:DataGridTextColumn x:Name="authorColumn" Binding="{Binding Path=Author}" Header="Author" Width="SizeToHeader" />
                    <sdk:DataGridTemplateColumn x:Name="dateCreatedColumn" Header="Date Created" Width="SizeToHeader">
                        <sdk:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <sdk:DatePicker SelectedDate="{Binding Path=DateCreated, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=DateCreated, StringFormat=\{0:d\}}" />
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTextColumn x:Name="imageURIColumn" Binding="{Binding Path=ImageURI}" Header="Image URI" Width="SizeToHeader" />
                    <sdk:DataGridTextColumn x:Name="languageColumn" Binding="{Binding Path=Language}" Header="Language" Width="SizeToHeader" />
                    <sdk:DataGridTemplateColumn x:Name="lastEditColumn" Header="Last Edit" Width="SizeToHeader">
                        <sdk:DataGridTemplateColumn.CellEditingTemplate>
                            <DataTemplate>
                                <sdk:DatePicker SelectedDate="{Binding Path=LastEdit, Mode=TwoWay, NotifyOnValidationError=true, ValidatesOnExceptions=true}" />
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellEditingTemplate>
                        <sdk:DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=LastEdit, StringFormat=\{0:d\}}" />
                            </DataTemplate>
                        </sdk:DataGridTemplateColumn.CellTemplate>
                    </sdk:DataGridTemplateColumn>
                    <sdk:DataGridTextColumn x:Name="longDescriptionColumn" Binding="{Binding Path=LongDescription}" Header="Long Description" Width="SizeToHeader" />
                    <sdk:DataGridTextColumn x:Name="shortDescriptionColumn" Binding="{Binding Path=ShortDescription}" Header="Short Description" Width="SizeToHeader" />
                    <sdk:DataGridTextColumn x:Name="titleColumn" Binding="{Binding Path=Title}" Header="Title" Width="SizeToHeader" />
                    <sdk:DataGridTextColumn x:Name="tourIDColumn" Binding="{Binding Path=TourID, Mode=OneWay}" Header="Tour ID" IsReadOnly="True" Width="SizeToHeader" />
                </sdk:DataGrid.Columns>
            </sdk:DataGrid>
        </Grid>
    <sdk:DataPager HorizontalAlignment="Left" Height="19" Margin="0,0,0,2" PageSize="10" VerticalAlignment="Bottom" Width="309"/>
        <riaControls:DomainDataSource AutoLoad="True" d:DesignData="{d:DesignInstance my1:Tour, CreateList=true}" Height="0" LoadedData="tourDomainDataSource_LoadedData" Name="tourDomainDataSource" QueryName="GetToursQuery" Width="0">
            <riaControls:DomainDataSource.DomainContext>
                <my:TourGuideDomainContext />
            </riaControls:DomainDataSource.DomainContext>
        </riaControls:DomainDataSource>
        
    </Grid>

</navigation:Page>